{extend name='admin@public/content'}
{block name="button"}
{if auth("$classuri/add")}
<button data-open='{:url("$classuri/add")}' data-title="添加公众号" class='layui-btn layui-btn-sm layui-btn-primary'>添加公众号</button>
{/if}

{/block}

{block name="content"}

<!-- 表单搜索 开始 -->
<form autocomplete="off" class="layui-form layui-form-pane form-search" action="{:request()->url()}" onsubmit="return false" method="get">
    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">公众号账号</label>
        <div class="layui-input-inline">
            <input name="username" value="{$Think.get.username|default=''}" placeholder="请输入公众号名" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item layui-inline">
        <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
    </div>
</form>
<!-- 表单搜索 结束 -->

<form onsubmit="return false;" data-auto="true" method="post">
    {empty name='list'}
    <p class="help-block text-center well">没 有 记 录 哦！</p>
    {else}
    <input type="hidden" value="resort" name="action">
    <table class="layui-table" lay-skin="line">
        <thead>
        <tr>
            <th class='list-table-check-td think-checkbox'>
                <input data-auto-none="" data-check-target='.list-check-box' type='checkbox'>
            </th>
            <th class="text-center">一键应用ID</th>
            <th class='text-left nowrap'>公众信息</th>
            <th class='text-left nowrap'>状态</th>
            <th class='text-left nowrap'>操作</th>
        </tr>
        </thead>
        <tbody>
        {foreach $list as $key=>$vo}
        <tr>
            <td class='list-table-check-td think-checkbox'>
                <input class="list-check-box" value='{$vo.id}' type='checkbox'>
            </td>
            <td class='text-left nowrap'>
                {$vo.id}
            </td>
            <td class='text-left nowrap'>
                {$vo.name}
            </td>
            <td class='text-left nowrap'>
                {if condition="$vo.status=='1'"} 正常{else/}停用{/if}
            </td>
            <td class='text-left nowrap'>

                <span class="text-explode">|</span>
                <a data-title="接入信息" href='{:url("$classuri/jump")}?id={$vo.id}'>进入公众号</a>

                {if auth("$classuri/edit")}
                <span class="text-explode">|</span>
                <a data-title="更改配置" data-open='{:url("$classuri/edit")}?id={$vo.id}'>更改配置</a>
                {/if}

                {if auth("$classuri/auth")}
                <span class="text-explode">|</span>
                <a data-title="接入信息" data-open='{:url("$classuri/auth")}?id={$vo.id}'>接入信息</a>
                {/if}

                {if auth("$classuri/del")}
                {if condition="$vo.id!=1"}
                <span class="text-explode">|</span>
                <a data-update="{$vo.id}"  data-field='delete' data-action='{:url("$classuri/del")}'>删除</a>
                {/if}
                {/if}

            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>
    {if isset($page)}<p>{$page|raw}</p>{/if}
    {/empty}
</form>
{/block}